<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <button>同意</button>
  <button>不同意</button>
</body>
<script>
  //公众号点击跳转到这个页面  然后重定向到确认页面
  var appid = 'wxdc7ed0f21b5d80bf&re'

  function getCode() {
    window.location.href =
      `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent('https://zg.particlesoft.info/frontenddev/consent.html?requestId=123')}&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect`;
  }
  getCode()
</script>

</html>